<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>四个方向三角形</title>
</head>

<body>

    <!--
        作者：放弃懒惰 链接：https: //www.zhihu.com/question/40149352/answer/3123033666

        来源：知乎 著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。
    -->
    <div class="triangle-up"></div>
    <div class="triangle-right"></div>
    <div class="triangle-left"></div>
    <div class="triangle-bottom"></div>
    <style>
        .triangle-up {
            display: inline-block;
            margin-left: 20px;
            width: 0;
            height: 0;
            border-right: 20px solid transparent;
            border-bottom: 30px solid #409eff;
            border-left: 20px solid transparent;
        }

        .triangle-right {
            display: inline-block;
            margin-left: 20px;
            width: 0;
            height: 0;
            border-top: 20px solid transparent;
            border-left: 30px solid #409eff;
            border-bottom: 20px solid transparent;
        }

        .triangle-left {
            display: inline-block;
            margin-left: 20px;
            width: 0;
            height: 0;
            border-right: 20px solid transparent;
            border-top: 30px solid #409eff;
            border-left: 20px solid transparent;
        }

        .triangle-bottom {
            display: inline-block;
            margin-left: 20px;
            width: 0;
            height: 0;
            border-top: 20px solid transparent;
            border-right: 30px solid #409eff;
            border-bottom: 20px solid transparent;
        }
    </style>
</body>

</html>